package com.sum.common.bean;

import java.util.Objects;

/**
 * 统计信息
 */
public class Stats {
    private final int tagCountPerSecond;
    private final int totalTags;
    private final int totalCount;

    public Stats() {
        this(0, 0, 0);
    }

    public Stats(int tagCountPerSecond, int totalTags, int totalCount) {
        this.tagCountPerSecond = tagCountPerSecond;
        this.totalTags = totalTags;
        this.totalCount = totalCount;
    }

    public int getTagCountPerSecond() { return tagCountPerSecond; }
    public int getTotalTags() { return totalTags; }
    public int getTotalCount() { return totalCount; }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Stats stats = (Stats) o;
        return tagCountPerSecond == stats.tagCountPerSecond &&
                totalTags == stats.totalTags &&
                totalCount == stats.totalCount;
    }

    @Override
    public int hashCode() {
        return Objects.hash(tagCountPerSecond, totalTags, totalCount);
    }

    @Override
    public String toString() {
        return "Stats{" +
                "tagCountPerSecond=" + tagCountPerSecond +
                ", totalTags=" + totalTags +
                ", totalCount=" + totalCount +
                '}';
    }
}